<template>
    <el-menu @select="handleSelect">

        <el-menu-item index="1" v-if="isAdmin">
            用户列表
        </el-menu-item>
        <el-menu-item index="2" v-if="isAdmin">
            职业列表
        </el-menu-item>
        <el-menu-item index="3" v-if="isAdmin">
            技能列表
        </el-menu-item>
        <el-menu-item index="4" v-if="isAdmin">
            课程列表
        </el-menu-item>
        <el-menu-item index="5">
            作业批改
        </el-menu-item>
    </el-menu>
</template>

<script>
    export default {
        data() {
            return {
                link: {
                    "1": {name: 'user-index'},
                    "2": {name: 'career-index'},
                    "3": {name: 'skill-index'},
                    "4": {name: 'course-index'},
                    "5": {name: 'user-work-index'}
                }
            }
        },
        computed: {
            isAdmin() {
                return config.isAdmin;
            }
        },
        methods: {
            handleSelect(key, keyPath) {
                this.$router.push(this.link[key]);
            }
        }
    }
</script>

<style scoped>

</style>